package mahi.inheritance;

import mahi.collection.Name1;

public class Test {
		public static void main(String[] args) {
			Class1 class1 = new Class1();
			Class2 class2 = new Class2();
			
			class1.attendTraining();
			class2.attendTraining();
			
			class1.seeRecording(1);
			class2.seeRecording(1);
			
			Class3 class3 = new Class3();
			class3.printNotes("");
			
			
			
			
			
			
			Child child = new Child();
			Parent parent = new Parent();
			
			
			//Upcasting
			Parent p0 = parent;
			Parent p1 = child;
			Parent p2 = new Child();
			Parent  p3 =  new Cousin();
			
			
			
			Parent p4 = getParent(1);
			p4.printname();
	
			
			Class5 c0 = new Class5();
			c0.printNotes("");
			TestInterface c1 = new Class5();
			c1.printNotes("");
			TestInterface c2 = new Class6();
			c2.printNotes("");
			
			//Downcasting
			child = (Child) parent;
			Child child1 = (Child) new Parent(); 
			Child child2 = (Child) new Parent(); 
			
			Cousin  cousin1 = new Cousin();
			Cousin  cousin2 = (Cousin) new Parent();
			
			cousin2.
			
			
		}

		private static Parent getParent(int i) {
			Parent  parent = null;
			if(i==1)
			{
				parent = new Child();
			}else{
				parent = new Cousin();
			}
			return parent;
		}
		
		
		
		
	
	
	
}
